import request from './request'

export const adminApi = {
  // 登录
  login(data) {
    return request({
      url: '/auth/login',
      method: 'post',
      data
    })
  },

  // 获取仪表板数据（平台总体统计）
  getDashboard() {
    return request({
      url: '/statistics/platform',
      method: 'get'
    })
  },

  // 获取统计数据
  getStatistics(params) {
    return request({
      url: '/statistics/overview',
      method: 'get',
      params
    })
  },

  // 获取用户统计
  getUserStatistics(params) {
    return request({
      url: '/statistics/users',
      method: 'get',
      params
    })
  },

  // 获取俱乐部统计
  getClubStatistics(params) {
    return request({
      url: '/statistics/clubs',
      method: 'get',
      params
    })
  },

  // 获取活动统计
  getEventStatistics(params) {
    return request({
      url: '/statistics/events',
      method: 'get',
      params
    })
  },

  // 获取场地统计
  getVenueStatistics(params) {
    return request({
      url: '/statistics/venues',
      method: 'get',
      params
    })
  },

  // 获取用户活跃度统计
  getUserActivityStatistics(days = 30) {
    return request({
      url: '/statistics/user-activity',
      method: 'get',
      params: { days }
    })
  },

  // 获取运动类型热度统计
  getSportTypePopularity(days = 30) {
    return request({
      url: '/statistics/sport-popularity',
      method: 'get',
      params: { days }
    })
  },

  // 获取城市活动分布统计
  getCityDistribution(days = 30) {
    return request({
      url: '/statistics/city-distribution',
      method: 'get',
      params: { days }
    })
  },

  // 获取俱乐部排行榜
  getClubRankings(type = 'activity', limit = 10) {
    return request({
      url: '/statistics/club-rankings',
      method: 'get',
      params: { type, limit }
    })
  },

  // 获取用户排行榜
  getUserRankings(type = 'points', limit = 10) {
    return request({
      url: '/statistics/user-rankings',
      method: 'get',
      params: { type, limit }
    })
  }
}

